This application contains subject matter which is related to the subject matter of the following applications, each of which is assigned to the same assignee as this application and filed on the same day as this application. Each of the below listed applications is hereby incorporated herein by reference in its entirety:
This invention relates, in general, to recovery techniques for programs executed on position sensitive input/output devices and, in particular, to repositioning an input/output device in order to retry a program.
A requirement of any robust computing environment is to be able to recover from errors, such as device hardware errors (e.g., mechanical, electrical) or recording media errors. In order to recover from some device or media errors, it is necessary to restart a program, either from the beginning or from some other point within the program. The restarting of a program, however, poses certain challenges, especially when the input/output device in which the program is executed is position sensitive.
Conventionally, with position sensitive devices, such as magnetic tape units, the position of the device when the programming error occurred is needed in order to restart the program. This position, however, is difficult to determine for some programs.
For example, when an error is encountered in a channel program that allows pipelining, it is difficult to know where the device was positioned when the error occurred. A channel program includes one or more channel command words. Some channel programs that have a plurality of channel command words allow pipelining of those channel command words. This means that a number of the channel command words may be initiated prior to receiving a response for any one of the command words. Thus, if an error has been detected for a second channel command word, as one example, but the control unit is already processing the fifth channel command word, then the device is positioned past the error and the position within the device of where the error occurred is unknown.
Thus, a need exists for a capability that enables an input/output device to be repositioned, even when the position of the input/output device when the error occurred is unknown. Further, a need exists for a capability that enables an input/output device to be repositioned without any knowledge of current positioning within the device. A further need exists for an enhanced capability that enables programs to be restarted, even when the program has been modified or the last known block-id representing the position of the input/output device is invalid.
The shortcomings of the prior art are overcome and additional advantages are provided through the provision of at least one program storage device readable by a machine, tangibly embodying at least one program of instructions executable by the machine to perform a method of repositioning within an input/output device. The method includes ascertaining that a program, that was executing on an input/output device sensitive to positioning is to be retried; and repositioning the input/output device to a predetermined position in order to retry the program. The repositioning is performed without knowledge of current positioning within the input/output device.
In one embodiment of the present invention, the predetermined position is determined. The determining includes, for instance, scanning a previously executed program for a command; adjusting a position identifier of the input/output device based upon a type of the command; and repeating the scanning and the adjusting until a prespecified limit is reached, wherein the position identifier then represents the predetermined position.
In a further embodiment of the present invention, the position identifier is stored in a control block associated with the input/output device for use during the repositioning. Additionally, a state associated with the position identifier is stored in the control block.
In a further aspect of the present invention, an article of manufacture including at least one computer usable medium having computer readable program code means embodied therein for causing repositioning within an input/output device is provided. The computer readable program code means in the article of manufacture includes, for instance, computer readable program code means for causing a computer to determine a position, within an input/output device sensitive to positioning, that is to be used to retry a program. The computer readable program code means for causing a computer to determine uses a first address representative of where a channel associated with the input/output device stopped processing the program and a second address representative of where a control unit associated with the device stopped processing the program. The computer readable program code means in the article of manufacture further includes computer readable program code means for causing a computer to reposition the input/output device to the determined position in order to retry the program.
In accordance with the principles of the present invention, a repositioning capability is provided that enables an input/output device to be repositioned without knowing the current position of the device or where an error occurred within the device. The repositioning capability of the present invention allows for enhanced error recovery on various interface types (e.g., parallel Original Equipment Manufacturers"" Information (OEMI), Enterprise Systems Connection Architecture (ESCON), Fiber Connection (FICON) and internal tape) for various input/output errors. The capabilities of the present invention allow the operating system to improve the reliability of input/output devices on errors where the ending channel command word cannot even be determined and which previously had to be treated as a permanent error (e.g., interface control check or channel control check with an invalid CCW address). Further, the repositioning capability of the present invention is applicable to any device where the software depends on media positioning to be able to recover from errors.
Additional features and advantages are realized through the techniques of the present invention. Other embodiments and aspects of the invention are described in detail herein and are considered a part of the claimed invention.